/**
 * Created by zhong on 2018/1/25.
 */
<template>
  <div class="modal" v-if="!msg.type">
    <div class="cover" @click="close()"></div>
    <div v-if="msg.type == 1" class="modal-box1">
      <a :href="msg.url">
        菜谱创建好喽，去看看吧
      </a>
    </div>
    <div v-if="msg.type == 2" class="modal-box2">
        msg.text
    </div>
  </div>
</template>

<script>
  export default {
    data () {
      return {
      }
    },
    props:['msg'],
    mounted: function() {
    },
    methods: {
      close:function(){
        this.msg.type = 0;
        this.$emit("close",'gohome')
      }
    }
  }
</script>

<style>
  .cover{
    height: 100%;
    width:100%;
    background: rgba(0,0,0,.05);
    position: absolute;
  }
  .modal{
    height: 100%;
    width:100%;
    position: fixed;
      left: 0;
      top:0;
  }
  .modal-box1,.modal-box2{
    margin: 30% auto;
  }
</style>
